package com.atguigu.educms.controller;


import com.atguigu.commonutils.Result;
import com.atguigu.educms.entity.CrmBanner;
import com.atguigu.educms.service.CrmBannerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 首页banner表 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2020-09-08
 */
@RestController
@RequestMapping("/educms/bannerfront")
@Slf4j
public class BannerFrontController {

    @Resource
    private CrmBannerService bannerService;

    //前台轮播图显示，查询所有图片数据
    @GetMapping("/findAll")
    public Result findAllBanner() {
       List<CrmBanner> list =  bannerService.selectAllBanner();
       log.info("查询的Banner数据: => {}",list);
       return Result.ok().data("list",list);

    }
}

